<template>
  <view class="search-shops">
    <view class="shop-list">
      <view class="shop-item" v-for="(shop, index) in shops" :key="index">
        <view class="item-head">
          <view class="shop-info">
            <image src="" mode="" />
            <view>
              <view class="shop-name">{{ shop.shop_name }}</view>
              <view class="distance">距离 1.4km</view>
            </view>
          </view>
          <view class="goto-shop" @click="gotoShop(shop.id)">进店</view>
        </view>
        <view class="item-body">
          <view class="shop-good-item" v-for="(good, i) in shop.good" :key="i">
            <image :src="good" mode="" />
            <view class="good-item-price">￥5999.00</view>
          </view>
        </view>
        <view class="item-foot">相关商品：433件</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    shops: {
      type: Array,
      default: [],
    },
  },
  data() {
    return {};
  },
  created() {},
  filters: {},
  computed: {},
  methods: {
    gotoShop(id) {
      this.$utils.toUrl("/mch/shop/shop?mch_id=" + id);
    },
  },
};
</script>

<style scoped lang="scss">
.search-shops {
  width: 100%;
  background-color: #f2f2f2;

  .shop-list {
    width: 100%;
    padding: 24rpx 0 24rpx;
    .shop-item {
      width: 702rpx;
      height: 404rpx;
      background: #ffffff;
      border-radius: 24rpx;
      margin: 0 24rpx 24rpx;
      padding: 24rpx 24rpx 0 24rpx;
      .item-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20rpx;
        .shop-info {
          display: flex;
          align-items: center;
          image {
            width: 80rpx;
            height: 80rpx;
            background: #ffffff;
            border: 1rpx solid #f6f6f6;
            border-radius: 8rpx;
            display: block;
            margin-right: 20rpx;
          }
          .shop-name {
            font-size: 28rpx;
            font-weight: 400;
            color: #262626;
            line-height: 36rpx;
            margin-bottom: 12rpx;
          }
          .distance {
            font-size: 22rpx;
            font-weight: 400;
            color: #808080;
            line-height: 36rpx;
          }
        }
        .goto-shop {
          width: 96rpx;
          height: 48rpx;
          background: #ffffff;
          border: 1rpx solid #fa2c19;
          border-radius: 24rpx;
          text-align: center;
          line-height: 48rpx;
          font-size: 24rpx;
          font-weight: 400;
          color: #fa2c19;
        }
      }
      .item-body {
        display: flex;
        align-items: center;
        .shop-good-item {
          width: 202rpx;
          height: 200rpx;
          background: #f6f6f6;
          border: 1rpx solid #f6f6f6;
          border-radius: 16rpx;
          position: relative;
          margin-right: 24rpx;
          image {
            width: 100%;
            height: 100%;
          }
          .good-item-price {
            width: 136rpx;
            height: 36rpx;
            background: #7b7b7b;
            border-radius: 0 16rpx 0 16rpx;
            position: absolute;
            left: 0;
            bottom: 0;
            z-index: 11;
            text-align: center;
            line-height: 36rpx;
            font-size: 24rpx;
            font-weight: 400;
            color: #ffffff;
          }
        }
        .shop-good-item:last-child {
          margin-right: 0cm;
        }
      }
      .item-foot {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        font-size: 22rpx;
        font-weight: 400;
        color: #808080;
        line-height: 36rpx;
        padding-top: 29rpx;
      }
    }
    .shop-item:last-child {
      margin-bottom: 0;
    }
  }
}
</style>
